<% Dim Action,AllSmsSize If Not MNBoard.FoundUser Then MNBoard.GoToErr(20) MNBoard.Position=MNBoard.Position&" → 用户控制面版" Action=Lcase(Request("Action")) MNBoard.Head "Sms.asp","","处理信件" ShowMySmsInfo() If Len(Action)>10 Then MNBoard.GoToErr(1) Select Case Action Case"save" SaveSms Case"del" Del Case"delall" DelAll Case"write" WriteSms Case Else ReadSms End Select MNBoard.Footer() Set MNBoard =Nothing Sub Del Dim ID,I,Rs ID=MNBoard.CheckNum(request("ID")) Set Rs=MNBoard.Execute("Select MyName,Name From[i_sms] where ID="&ID&" And (Name='"&MNBoard.MyName&"' or MyName='"&MNBoard.MyName&"')") If not Rs.eof then If Lcase(MNBoard.MyName)=Lcase(Rs(0)) Then MNBoard.execute("Update [i_sms] set MyFlag=2 where ID="&ID) Else MNBoard.execute("Update [i_sms] set Flag=2 where ID="&ID) End If MNBoard.Execute("Delete from [i_sms] where MyFlag=2 And Flag=2") MNBoard.Execute("Update [i_User] set SmsSize=SmsSize-1 where ID="&MNBoard.MyID) End If Rs.close Set Rs=Nothing Response.Redirect "sms.asp" End Sub Sub DelAll Dim ID,I ID=MNBoard.CheckNum(request("ID")) I=0 If ID=1 Then'删收箱 I=MNBoard.Execute("select count(*) From[i_Sms] where Name='"&MyName&"' And Flag=0" )(0) MNBoard.Execute("Update [i_sms] Set MyFlag=2 where MyName='"&MNBoard.MyName&"'") ElseIf ID=2 Then'删发箱 I=MNBoard.Execute("select count(*) From[i_Sms] where MyName='"&MyName&"' And Flag<>2" )(0) MNBoard.Execute("Update [i_sms] Set Flag=2 where Name='"&MNBoard.MyName&"'") Else MNBoard.Execute("Update [i_sms] Set Flag=2 where Name='"&MNBoard.MyName&"'") MNBoard.Execute("Update [i_sms] Set MyFlag=2 where MyName='"&MNBoard.MyName&"'") End If If isnull(I) Then I=0 MNBoard.Execute("Update [i_User] set SmsSize="&i&" where ID="&MNBoard.MyID) MNBoard.Execute("Delete from [i_sms] where MyFlag=2 And Flag=2") Session(CacheName & "MyInfo") = Empty MNBoard.Alert"清空所有信件成功!","Sms.asp" End Sub Sub ShowMySmsInfo() Dim SmsSize,content SmsSize=int(SESSION(CacheName & "MyInfo")(20)) AllSmsSize=SmsSize/Int(SESSION(CACHENAME & "MYGRADEINFO")(18))*100 If AllSmsSize>100 Then AllSmsSize=100 IF AllSmsSize<0 Then AllSmsSize=0 IF AllSmsSize>0 And AllSmsSize<1 Then AllSmsSize=1 Content=SmsSize/SESSION(CacheName & "MyGradeInfo")(18)*250 If Content>250 Then Content=250 Content="
信箱容量:
已使用 "&Int(AllSmsSize)&" %
收件箱 发件箱 写新留言  清空信箱
" Response.Write MNBoard.ReadSkins("用户控制面版") MNBoard.ShowTable"论坛留言信箱",Content End Sub Sub ReadSms() Dim S,div,Content,Temp,UserPic,Rs,P,strPageInfo,Arr_Rs,I,Caption,bgColor,IUBB,Sqlwhere,title,UserName If Action="elapse" Then Title="发送的信件记录" Sqlwhere="Name='"&MNBoard.MyName&"' and Flag=0" ElseIf Action="colloquy" Then UserName=Request.querystring("Name") If Not MNBoard.Fun.CheckName(UserName) Then MNBoard.GoToErr(1) Title="和"&UserName&"的交谈记录" Sqlwhere="(MyName='"&MNBoard.MyName&"' and Name='"&UserName&"' and MyFlag<2) or (Name='"&MNBoard.MyName&"' And MyName='"&UserName&"' and Flag=0)" Else Title="收取信件" Sqlwhere="MyName='"&MNBoard.MyName&"' and MyFlag<2" End If Set P = New Cls_PageView P.strTableName = "[i_Sms]" P.strPageUrl="?Action="&Action P.strFieldsList = "ID,Name,Content,AddTime,MyFlag,UbbString,Flag,MyName" P.strCondiction = Sqlwhere P.strOrderList = "ID desc" P.strPrimaryKey = "ID" P.intPageSize = 10 P.intPageNow = Request.querystring("page") P.strCookiesName = "Sms"&Action P.InitClass Arr_Rs = P.arrRecordInfo strPageInfo = P.strPageInfo Set P = nothing If IsArray(Arr_Rs) Then Set IUBB=New Cls_IUBB Div="
" If MNBoard.MSIE Then Div=Replace(Div,"min-","padding-right:0px; overflow-x: hidden;") End If For i = 0 to UBound(Arr_Rs, 2) IUBB.UbbString=Arr_Rs(5,I) If lcase(Arr_Rs(1,I))=lcase(MNBoard.MyName) Then Temp="发送给 "&Arr_Rs(7,I)&" 的信件  " If Action="elapse" Then Temp=Temp&"查看会话记录 " If Session(CacheName & "MyInfo")(11)="1" Then UserPic="QQ头像" Else UserPic="" End if Else Set Rs=MNBoard.execute("select top 1 IsQQpic,QQ,Pic,PicW,PicH from [i_User] where Name='"&Arr_Rs(1,I)&"'") If Not Rs.eof then Temp="查看资料 回复 查看会话记录 " IF Rs(0)=1 then UserPic="QQ头像" Else UserPic="" End If End if Rs.Close Set Rs=nothing End If If I mod 2 <>0 Then bgColor="background-color: "&MNBoard.SkinsPIC(1)&";" Else bgColor="" S="

"&Arr_Rs(1,I)&"
"&UserPic&"
" S=S&DIV&Temp&"删除 " IF Arr_Rs(4,I)=1 Then S=S&"新的留言" S=S&"
"&IUBB.UBB(Arr_Rs(2,I),2)&"

留言时间: "&Arr_Rs(3,I)&"
" Content=Content&S Next Content=Content&"
"&strPageInfo&"

" Set IUBB=Nothing End If MNBoard.ShowTable Title,Content If Session(CacheName&"updateSms")="" or Int(Session(CacheName & "MyInfo")(27))>0 then MNBoard.ExeCute("Update [i_user] Set NewSmsNum=0 Where Name='"&MNBoard.MyName&"'") MNBoard.ExeCute("Update [i_Sms] Set MyFlag=0 Where MyFlag=1 and MyName='"&MNBoard.MyName&"'") Session(CacheName&"updateSms")="Y" Session(CacheName & "MyInfo") = Empty End If End Sub Sub WriteSms() If AllSmsSize=100 Then Temp="系统警告":S="

  亲爱的MNB用户,您的论坛留言信箱容量已满,请尽快删除一些信件!


" Else Dim Name,Rs,S,Temp,Content,ID ID=MNBoard.CheckNum(request("ID")) Name=request.querystring("Name") If Not MNBoard.Fun.CheckName(Name) Then MNBoard.GoToErr(1) Set Rs=MNBoard.execute("select Content from [i_sms] where name='"&Name&"' And MyName='"&MNBoard.MyName&"' and Id="&ID&"") if not Rs.eof then Content=Rs("Content") End if Rs.Close Set Rs=nothing S="
" S=S&MNBoard.Row("留言对象:","","75%","") Temp="信件内容:
内容限制"&Session(CacheName & "MyGradeInfo")(19)&"个字节
" Temp=Temp&"每天最多可以发送"&Session(CacheName & "MyGradeInfo")(13)&"封" If Int(MNBoard.Info(123)) >0 Then Temp=Temp & "
每封收取发送费:"&MNBoard.Info(123)&MNBoard.Info(120) If MNBoard.Info(60)="1" Then Content="UbbEdit()" Else Content="HtmlEdit()" Content="" S=S&MNBoard.Row(""&Temp,Content,"75%","") S=S&"
" S=S&"  " S=S&"
" Temp="签写发送留言" End If MNBoard.ShowTable Temp,S End Sub Sub SaveSms() 'MNBoard.CheckMake() Dim S,Content,ToName,TmpUbbString If int(SESSION(CacheName & "MyInfo")(7))now() then MNBoard.GoToErr(53) ToName=MNBoard.Fun.GetForm("caption") Content=MNBoard.Fun.GetForm("Content") If ToName="" or Content="" then MNBoard.GoToErr(36) If MNBoard.Fun.CheckIsEmpty(Content) Then MNBoard.GoToErr(50) If MNBoard.Info(60)="1" Then Content=MNBoard.Fun.Replacehtml(Content) TmpUbbString=MNBoard.Fun.UbbString(Content) If Not MNBoard.Fun.CheckName(ToName) Then MNBoard.GoToErr(41) IF Len(Content)>Int(Session(CacheName & "MyGradeInfo")(19)) Then MNBoard.GoToErr(29) S=MNBoard.Execute("Select Count(*) From[i_Sms] where Name='"&MNBoard.MyName&"' And DATEDIFF('d',AddTime,'"&MNBoard.NowBbsTime&"')<1")(0) If Isnull(S) Then S=0 If S>Int(Session(CacheName & "MyGradeInfo")(13)) Then MNBoard.GoToErr(55) If MNBoard.execute("select Name From [i_User] where name='"&ToName&"'and IsDel=0").eof Then MNBoard.GoToErr(54) MNBoard.execute("insert into [i_sms](name,Content,Myname,ubbString,MyFlag)values('"&MNBoard.MyName&"','"&Content&"','"&ToName&"','"&TmpUbbString&"',1)") MNBoard.execute("update [i_user] Set Coin=Coin-"&int(MNBoard.Info(123))&" where ID="&MNBoard.MyID) MNBoard.ExeCute("Update [i_user] Set NewSmsNum=NewSmsNum+1,SmsSize=SmsSize+1 Where Name='"&ToName&"'") Session(CacheName&"SmsTime")=Now() '在线通知 MNBoard.UpdageOnline ToName,1 Content="
  • 已经成功的给 "&ToName&" 留言
  • 本站扣除手续费 "&MNBoard.Info(123)&MNBoard.Info(120)&"
  • 返回首页
  • 返回我的信箱
  • " MNBoard.ShowTable"发送成功",Content End Sub %>